package com.wangyonghao.harmonyocrs.pojo;

/**
 * @author by wangyonghao
 * @description:公共返回对象
 * @Date: Created in 17:52 on 2021/4/18
 */
public class Result<T> {
    private long code;
    private String message;
    private T obj;

    public long getCode() {
        return code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }

    public Result(long code, String message, T obj) {
        this.code = code;
        this.message = message;
        this.obj = obj;
    }

    public static Result success(String message){
        return new Result(200,message,null);
    }

    public static Result success(String message,Object obj){
        return new Result(200,message,obj);
    }

    public static Result error(String message){
        return new Result(500,message,null);
    }

    public static Result error(String message,Object obj){
        return new Result(500,message,obj);
    }

}
